home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The 640 MEG Shareware Studio 2
/
The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO
/
graphics
/
rmtc02.zip
/
READXGF.C
< prev
next >
Wrap
Text File
|
1992-04-06
|
555b
|
30 lines
#include <stdio.h>
#include <alloc.h>
#include <graphics.h>
void main()
{
void *imgBuf;
FILE *F;
int driver = EGA;
int mode = EGAHI;
unsigned int size;
if ((F=fopen("gcar.xgf","rb")) == NULL)
{
printf("Can't open file!\n");
exit(0);
}
size=filelength(fileno(F));
imgBuf = malloc(size);
fread(imgBuf,size,1,F);
fclose(F);
initgraph(&driver, &mode, "");
setfillstyle(SOLID_FILL,BLUE);
bar(0,0,639,349);
putimage(300,150,imgBuf,COPY_PUT);
free(imgBuf);
getch();
closegraph();
}